/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.eclipse.emf.ecore.impl;

import org.eclipse.emf.ecore.EAccessSpc;
import org.eclipse.emf.ecore.DSManagementInterface;
import org.eclipse.emf.ecore.DSUserInput;
import org.eclipse.emf.ecore.EcorePackage;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Access Spc</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EAccessSpcImpl.impl.AccessSpcImpl#getDS_userInput <em>DS user Input</em>}</li>
 *   <li>{@link EAccessSpcImpl.impl.AccessSpcImpl#getDS_managementInterface <em>DS management Interface</em>}</li>
 *   <li>{@link EAccessSpcImpl.impl.AccessSpcImpl#getDataSourceType <em>Data Source Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class EAccessSpcImpl extends EObjectImpl implements EAccessSpc {
	/**
	 * The cached value of the '{@link #getDS_userInput() <em>DS user Input</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDS_userInput()
	 * @generated
	 * @ordered
	 */
	protected DSUserInput dS_userInput;

	/**
	 * The cached value of the '{@link #getDS_managementInterface() <em>DS management Interface</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDS_managementInterface()
	 * @generated
	 * @ordered
	 */
	protected DSManagementInterface dS_managementInterface;

	/**
	 * The default value of the '{@link #getDataSourceType() <em>Data Source Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDataSourceType()
	 * @generated
	 * @ordered
	 */
	protected static final String DATA_SOURCE_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getDataSourceType() <em>Data Source Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDataSourceType()
	 * @generated
	 * @ordered
	 */
	protected String dataSourceType = DATA_SOURCE_TYPE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EAccessSpcImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return EcorePackage.Literals.EACCESS_SPC;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DSUserInput getDS_userInput() {
		return dS_userInput;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetDS_userInput(DSUserInput newDS_userInput, NotificationChain msgs) {
		DSUserInput oldDS_userInput = dS_userInput;
		dS_userInput = newDS_userInput;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ACCESS_SPC__DS_USER_INPUT, oldDS_userInput, newDS_userInput);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDS_userInput(DSUserInput newDS_userInput) {
		if (newDS_userInput != dS_userInput) {
			NotificationChain msgs = null;
			if (dS_userInput != null)
				msgs = ((InternalEObject)dS_userInput).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EcorePackage.ACCESS_SPC__DS_USER_INPUT, null, msgs);
			if (newDS_userInput != null)
				msgs = ((InternalEObject)newDS_userInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EcorePackage.ACCESS_SPC__DS_USER_INPUT, null, msgs);
			msgs = basicSetDS_userInput(newDS_userInput, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ACCESS_SPC__DS_USER_INPUT, newDS_userInput, newDS_userInput));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DSManagementInterface getDS_managementInterface() {
		return dS_managementInterface;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetDS_managementInterface(DSManagementInterface newDS_managementInterface, NotificationChain msgs) {
		DSManagementInterface oldDS_managementInterface = dS_managementInterface;
		dS_managementInterface = newDS_managementInterface;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE, oldDS_managementInterface, newDS_managementInterface);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDS_managementInterface(DSManagementInterface newDS_managementInterface) {
		if (newDS_managementInterface != dS_managementInterface) {
			NotificationChain msgs = null;
			if (dS_managementInterface != null)
				msgs = ((InternalEObject)dS_managementInterface).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE, null, msgs);
			if (newDS_managementInterface != null)
				msgs = ((InternalEObject)newDS_managementInterface).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE, null, msgs);
			msgs = basicSetDS_managementInterface(newDS_managementInterface, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE, newDS_managementInterface, newDS_managementInterface));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getDataSourceType() {
		return dataSourceType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDataSourceType(String newDataSourceType) {
		String oldDataSourceType = dataSourceType;
		dataSourceType = newDataSourceType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ACCESS_SPC__DATA_SOURCE_TYPE, oldDataSourceType, dataSourceType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case EcorePackage.ACCESS_SPC__DS_USER_INPUT:
				return basicSetDS_userInput(null, msgs);
			case EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE:
				return basicSetDS_managementInterface(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case EcorePackage.ACCESS_SPC__DS_USER_INPUT:
				return getDS_userInput();
			case EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE:
				return getDS_managementInterface();
			case EcorePackage.ACCESS_SPC__DATA_SOURCE_TYPE:
				return getDataSourceType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case EcorePackage.ACCESS_SPC__DS_USER_INPUT:
				setDS_userInput((DSUserInput)newValue);
				return;
			case EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE:
				setDS_managementInterface((DSManagementInterface)newValue);
				return;
			case EcorePackage.ACCESS_SPC__DATA_SOURCE_TYPE:
				setDataSourceType((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case EcorePackage.ACCESS_SPC__DS_USER_INPUT:
				setDS_userInput((DSUserInput)null);
				return;
			case EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE:
				setDS_managementInterface((DSManagementInterface)null);
				return;
			case EcorePackage.ACCESS_SPC__DATA_SOURCE_TYPE:
				setDataSourceType(DATA_SOURCE_TYPE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case EcorePackage.ACCESS_SPC__DS_USER_INPUT:
				return dS_userInput != null;
			case EcorePackage.ACCESS_SPC__DS_MANAGEMENT_INTERFACE:
				return dS_managementInterface != null;
			case EcorePackage.ACCESS_SPC__DATA_SOURCE_TYPE:
				return DATA_SOURCE_TYPE_EDEFAULT == null ? dataSourceType != null : !DATA_SOURCE_TYPE_EDEFAULT.equals(dataSourceType);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (dataSourceType: ");
		result.append(dataSourceType);
		result.append(')');
		return result.toString();
	}

} //AccessSpcImpl
